/*
 * @Author: DUST
 * @Date: 2023-11-24 16:39:06
 * @LastEditors: DUST
 * @LastEditTime: 2024-11-11 15:47:05
 * @FilePath: \business-card-system\server\app\model\BusinessCardUser.ts
 * @Description: 
 * undefined
 */
import { Column, DataType, Model, Table } from "sequelize-typescript"

@Table({
  tableName: "BusinessCardUser",
  timestamps: true, // 自动维护时间
  freezeTableName: true, // 禁止修改表名，如果不写会把表名自动复数化，users
  paranoid: true, // 软删除
  indexes: [{ unique: true, fields: ["id"] }],
})
export default class BusinessCardUser extends Model<BusinessCardUser> {
  @Column({
    type: DataType.INTEGER.UNSIGNED,
    autoIncrement: true,
    primaryKey: true,
    allowNull: false,
    comment: "用户id",
  })
  id!: number;

  @Column({
    type: new DataType.STRING(128),
    allowNull: false,
    comment: "人员姓名",
  })
  name!: string;

  @Column({
    type: new DataType.STRING(128),
    allowNull: false,
    comment: "用户联系方式",
  })
  mobile!: string;

  @Column({
    type: new DataType.STRING(128),
    allowNull: false,
    comment: "用户邮箱",
  })
  email!: string;

  @Column({
    type: new DataType.STRING(128),
    comment: "用户头像",
  })
  avatar!: string;

  @Column({
    type: new DataType.STRING(128),
    // allowNull: false,
    comment: "用户名片二维码",
  })
  miniQrcode!: string;

  @Column({
    type: new DataType.STRING(128),
    allowNull: false,
    comment: "用户职位",
  })
  job!: string;

  @Column({
    type: new DataType.STRING(128),
    allowNull: false,
    comment: "办公地址",
  })
  addr!: string;

  @Column({
    type: new DataType.STRING(256),
    allowNull: false,
    comment: "公司名称，多个用逗号隔开",
  })
  companyName!: string;

  @Column({
    type: new DataType.STRING(128),
    allowNull: false,
    comment: "用户微信号",
  })
  wxNumber!: string;
}